package robocup.component.speechacts.coachlanguage;

import java.util.LinkedList;

public class Tok {

  private boolean               clear         = false;

  private int                   id            = 0;

  private Condition             condition     = null;

  private LinkedList<Directive> directiveList = new LinkedList<Directive>();

  public void addDirective(final Directive directive) {

    this.directiveList.add(directive);
  }

  public Condition getCondition() {

    return this.condition;
  }

  public void setCondition(final Condition condition) {

    this.condition = condition;
  }

  public LinkedList<Directive> getDirectiveList() {

    return this.directiveList;
  }

  public void setDirectiveList(final LinkedList<Directive> directiveList) {

    this.directiveList = directiveList;
  }

  public boolean isClear() {

    return this.clear;
  }

  public void setClear(final boolean clear) {

    this.clear = clear;
  }

  public int getId() {

    return this.id;
  }

  public void setId(final int id) {

    this.id = id;
  }

  @Override
  public String toString() {

    final StringBuffer buf = new StringBuffer();
    if (this.clear) {
      buf.append("(clear)");
    }
    else {
      buf.append("(" + this.id + " " + this.condition.toString());
      for (final Directive dir : this.directiveList) {
        buf.append(" " + dir.toString());
      }
      buf.append(")");
    }
    return buf.toString();
  }

}
